package com.central.common.utils;

import com.alibaba.ttl.TransmittableThreadLocal;
import com.mall.entity.Users;

/**
 * 
 * @author wdd
 *
 */
public class GlobalUserContext {

	private static ThreadLocal<Users> USER_LOCAL = new TransmittableThreadLocal<>();

	public static void setUser(Users userDO) {
		USER_LOCAL.set(userDO);
	}

	public static Users getUser() {
		return USER_LOCAL.get();
	}
	
	public static void removeUser() {
		USER_LOCAL.remove();
	}
	
}
